
#ifndef __3D_VECTOR_H


#define __3D_VECTOR_H


#include "head.h"


class dvector;


class vector {


public:


    double vect_x;


    double vect_y;


    double vect_z;


    vector();


    vector(double x, double y, double z);
    //   vector operator=(const vector &b);


    vector operator+(const vector& b);


    vector operator-(const vector& b);


    vector operator-();


    double operator*(const vector& b);


    friend vector operator*(const double& a, const vector& b);


    friend double amp_R(vector& r_, vector& r1_);


    vector operator=(const dvector& b);


    vector operator*(const double& b);


    vector operator/(const double& b);


    vector operator^(const vector& b);


    void print();


    double abs_vector();


};

class dvector {


public:


    double vect_x;


    double vect_y;


    double vect_z;


    dvector();


    dvector(double x, double y, double z);

    dvector operator+(const dvector& b);

    dvector operator-(const dvector& b);

    dvector operator-();

    double operator*(const dvector& b);

    friend dvector operator*(const double& a, const dvector& b);

    friend double amp_R(dvector& r_, dvector& r1_);

    inline dvector operator=(const vector& b) {

        vect_x = b.vect_x;

        vect_y = b.vect_y;

        vect_z = b.vect_z;

        return *this;

    }

    dvector operator*(const double& b);

    dvector operator/(const double& b);

    dvector operator^(const dvector& b);


    void print();


    double abs_vector();

    dvector(vector& a) {

        vect_x = a.vect_x;

        vect_y = a.vect_y;

        vect_z = a.vect_z;

    }


};


class cvector {


public:


    Complex vect_x;


    Complex vect_y;


    Complex vect_z;


    cvector();


    cvector(Complex x, Complex y, Complex z);


    cvector operator+(const cvector& b);


    cvector operator-(const cvector& b);


    cvector operator-();


    Complex operator*(const cvector& b);


    cvector operator*(const Complex& b);


    cvector operator/(const Complex& b);


    friend cvector operator*(const vector& a, const Complex& b);


    friend cvector operator*(const Complex& b, const vector& a);


    friend cvector operator*(const Complex& b, const cvector& a);


    friend Complex operator*(const cvector& a, const vector& b);


    friend Complex operator*(const vector& a, const cvector& b);


    friend cvector operator-(const cvector& a, const vector& b);


    friend cvector operator-(const vector& a, const cvector& b);


    friend cvector operator+(const cvector& a, const vector& b);


    friend cvector operator+(const cvector& a, const cvector& b);


    /*friend cvector operator/(const cvector &a,const Complex &b);


    friend cvector operator/(const cvector &a,const double &b);


    friend cvector operator*(const cvector &a,const Complex &b);


    friend cvector operator*(const cvector &a,const double &b);


    friend cvector operator*(const Complex &b,const cvector &a);


    friend cvector operator*(const double &b,const cvector &a);*/


    cvector operator^(const cvector& b);


    cvector operator^(const vector& b);


    void print();


    friend cvector conjugate(const cvector& a);


    friend vector real(cvector& a);


    friend vector imag(cvector& a);


    double abs_cvector();

    cvector(vector& a) {
        vect_x = Complex(a.vect_x);
        vect_y = Complex(a.vect_y);
        vect_z = Complex(a.vect_z);
    }

};


#endif